// nodes/DecisionNode.js
import { PolygonNode, PolygonNodeModel } from '@logicflow/core'

class DecisionNodeModel extends PolygonNodeModel {
  initNodeData(data) {
    super.initNodeData(data)
    this.text = data.text || '决策'
    this.points = [
      [50, 0],
      [100, 50],
      [50, 100],
      [0, 50]
    ]
    this.properties = {
      ...data.properties,
      condition: data.properties?.condition || ''
    }
  }
  
  getNodeStyle() {
    const style = super.getNodeStyle()
    style.fill = '#fff2e8'
    style.stroke = '#fa8c16'
    return style
  }
}

class DecisionNodeView extends PolygonNode {}

export default {
  type: 'decision-node',
  view: DecisionNodeView,
  model: DecisionNodeModel
}